<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        onload =function (){
            d1.innerText="测试文本";
        }
    </script>
</head>
<body>
<div id="d1"></div>

<select id="s1" onchange="changefn()">
    <option>北京</option>
    <option>上海</option>
    <option>广州</option>
</select>
<input type="text" id="i1" onblur="blurfn()">
<script>
    //失去焦点事件 onblue  可以理解为编辑完成的时间点
    function blurfn() {
        d1.innerText=i1.value;
    }
    function changefn() {
        d1.innerText = s1.value;
    }
</script>
</body>
</html>